#include<iostream>
#include<stdio.h>
#include<conio.h>
using namespace std;
class CPolygon
{
protected:
	int width;
	int height;
public:
	void setvalues(int a,int b);
};
void CPolygon::setvalues(int a,int b)
{
	width=a;
	height=b;
}
class COutput
{
public:
	void output(int i);
};
void COutput::output(int i)
{
	cout<<i<<endl;
}
class CRectangle:public CPolygon,public COutput
{
public:
	int area();
};
int CRectangle::area()
{
	return(width*height);
}
class CTrangle:public CPolygon,public COutput
{
public:
	int area();
};
int CTrangle::area()
{
	return(width*height/2);
}
int main()
{
	CRectangle rect;
	CTrangle trgl;
	rect.setvalues(4,5);
	trgl.setvalues(4,5);
	rect.output(rect.area());
	trgl.output(trgl.area());
	getch();
	return 0;
}